import { Component, PropsWithChildren } from "react";
import { Provider } from "react-redux";
import store from "@/store";
import Global from "@/components/Global";
import "./app.scss";

class App extends Component<PropsWithChildren> {
    componentDidMount() {}

    componentDidShow() {}

    componentDidHide() {}

    componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {
        console.log(error, errorInfo);
    }

    // this.props.children 是将要会渲染的页面
    render() {
        return (
            <Provider store={store}>
                <Global />
                {this.props.children}
            </Provider>
        );
    }
}

export default App;
